package com.mhkj.base.region.entity;

import javax.persistence.*;

import com.mics.core.system.base.entity.BaseDomain;

import java.util.Objects;

/**
 * @Author: sand
 * @Desc: 省市区域公用实体类
 * @Date: 15:32 2018/6/19
 */
@Entity
@Table(name = "t_sys_nation")
public class TSysNation extends BaseDomain {

    /**
	 * 序号
	 */
	private static final long serialVersionUID = 1991559487144400808L;

	@Column(name = "code", nullable = true, length = 40)
    private String code;

    @Column(name = "province", nullable = true, length = 40)
    private String province;
    @Column(name = "city", nullable = true, length = 40)
    private String city;
    @Column(name = "parent_id", nullable = true)
    private Long parentId;

    @Column(name = "district", nullable = true, length = 40)
    private String district;
    @Column(name = "sort", nullable = true)
    private Integer sort;

    @Transient
    private String fullName;

    public String getFullName() {
        return province+city;
    }

    public void setFullName(String fullName) {
        this.fullName = fullName;
    }


    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getProvince() {
        return province;
    }

    public void setProvince(String province) {
        this.province = province;
    }


    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }


    public Long getParentId() {
        return parentId;
    }

    public void setParentId(Long parentId) {
        this.parentId = parentId;
    }


    public String getDistrict() {
        return district;
    }

    public void setDistrict(String district) {
        this.district = district;
    }





    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }

        TSysNation that = (TSysNation) o;

        return Objects.equals(getId(), that.getId());
    }

    @Override
    public String toString() {
        return "TSysNation{" +
                "province='" + province + '\'' +
                ", city='" + city + '\'' +
                ", fullName='" + fullName + '\'' +
                '}';
    }
}
